/*
 * @Author: 13177709051 3506463075@qq.com
 * @Date: 2024-10-14 23:31:32
 * @LastEditors: 13177709051 3506463075@qq.com
 * @LastEditTime: 2024-10-15 19:00:14
 * @FilePath: /cjb/linux-operating-system-network/linux7/myproc.c
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{

    int ret = fork();
    if(ret < 0)
    {
        perror("fork");
        return 1;
    }
    else if(ret == 0)
    { //child
        printf("I am child : %d!, ret: %d\n", getpid(), ret);
    }
    else
    { //father
        printf("I am father : %d!, ret: %d\n", getpid(), ret);
    }
    sleep(1);
    return 0;

}




// int ret = fork();
    // printf("hello proc : %d!, ret: %d\n", getpid(), ret);
    // sleep(10);
    // return 0;